// 封装的axios请求
import axios from 'axios';
const request = axios.create({
  baseURL: 'http://itsui.top', // 基础路径
  timeout: 10000,
});

request.interceptors.request.use(
  (config) => {
    // 请求带上token
    // config.headers.Authorization = `Bearer ${localStorage.getItem('token')}`
    return config;
  },
  (error) => {
    return Promise.reject(error);
  }
);

request.interceptors.response.use(
  (response) => {
    return response;
  },
  (error) => {
    return Promise.reject(error);
  }
);

export default request;
